package com.test.io;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

public class FormmattedMemoryInput {
	public static void main(String[] args) throws IOException {
		try {
			DataInputStream in = new DataInputStream(new ByteArrayInputStream(
					BufferedInputFile.read("FormmattedMemoryInput.java")
							.getBytes()));
			//if you read characters from a DataInputStream one byte at a time using readByte()
			// any byte value is a legitimate result ,you can use the available() method to find out 
			//how many more characters are available
			while(in.available()!=0){
				System.out.println((char)in.readByte());
			}
			
		} catch (Exception e) {
			System.err.println("End of the stream");
		}
	}
}
